package com.doyoulike.enums;

import java.util.Arrays;

/**
 * @author duzhou
 * @version 2021/4/28
 */
public enum GenTypeEnum{

    单表("crud", "单表"),
    主子表("crud_child", "主子表"),
    树结果("tree", "树"),
    只生成Dao("dao", "只生成Dao"),
    只生成实体("entity", "只生成实体"),
    只生成文档("document", "只生成文档");


    private String key;
    private String value;

    GenTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static GenTypeEnum getByKey(String key) {
        return Arrays.stream(GenTypeEnum.values())
                .filter(s -> s.getKey().equals(key))
                .findFirst().get();
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
